﻿using Mss.Common.Helpers;

namespace Mss.Common.DomainObjects
{
    public class Error : NotifyPropertyChangedBase
    {
        #region Fields

        private string _description;
        private string _message;

        #endregion

        #region Constructors

        public Error(string message, string description)
            : this(message)
        {
            Description = description;
        }

        public Error(string message)
        {
            Message = message;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Error short message.
        /// </summary>
        public string Message
        {
            get { return _message; }
            private set
            {
                if (_message == value) return;
                _message = value;
                RaisePropertyChanged("Message");
            }
        }

        /// <summary>
        /// Error description.
        /// </summary>
        public string Description
        {
            get { return _description; }
            set
            {
                if (_description == value) return;
                _description = value;
                RaisePropertyChanged("Description");
            }
        }

        #endregion
    }
}